package com.flycms.modules.site.controller;

import com.flycms.common.controller.BaseController;
import com.flycms.common.utils.StringUtils;
import com.flycms.modules.site.service.SiteService;
import com.flycms.modules.system.service.SystemService;
import com.flycms.modules.template.service.SiteTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;


import java.io.IOException;

/**
 * Biz-Boot, All rights reserved
 * 版权：企业之家网 -- 企业建站管理系统<br/>
 * 开发公司：97560.com<br/>
 *
 * @author 孙开飞
 */
@Controller
@RequestMapping("/site")
public class SiteIndexController extends BaseController {
    @Autowired
    private SiteService siteService;
    @Autowired
    protected SystemService systemService;
    @Autowired
    protected SiteTemplateService theme;

    @GetMapping("/index{url.suffix}")
    public String index(Model model) throws IOException
    {
        String domainString=StringUtils.twoStageDomain(request.getRequestURL().toString());
        if (!org.springframework.util.StringUtils.isEmpty(domainString)) {
            long siteId = siteService.findSiteByDomain(domainString);
            System.out.println(domainString+"============="+siteId+"============="+request.getRequestURL());
            if (!org.springframework.util.StringUtils.isEmpty(siteId)) {

            }
        }
        return "/websiteTemplate/qianzhu/index";
    }

}
